require("../assets/iconfont/iconfont.css")

function renderNav(pathname) {
    let body = document.querySelector("body");
    let arr = [
        {
            icon:"icon-shouye",
            textContent:"首页",
            path:"./home.html"
        },
        {
            icon:"icon-heart",
            textContent:"运动",
            path:"./run.html"
        },
        {
            icon:"icon-pintu",
            textContent:"圈子",
            path:"./circle.html"
        },
        {
            icon:"icon-wode1",
            textContent:"我的",
            path:"./mine.html"
        },
    ]
    let html = ""
    html = `
    ${arr.map(function(v,i){
     return  `<a href="${v.path}" class="b_com ${v.path === `./${pathname}.html`?"active":""}">
        <span class="iconfont ${v.icon} tusize"></span>
        <span class="fs15">${v.textContent}</span>
        </a>`
    }).join("")}
    `
//  let pathname = location.pathname 
 let div = document.createElement("div")
 div.className = "bottom df jcsb fn"  
 div.innerHTML = html;
 body.append(div)
}
module.exports = renderNav